﻿namespace Ocelot.Admin.Api.Application
{
    public interface IConsulService
    {

        /// <summary>
        /// 回滚
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<string> PostRollBackAsync(int id);

        /// <summary>
        /// 获取最近的备份
        /// </summary>
        /// <param name="key"></param>
        /// <param name="dc"></param>
        /// <returns></returns>
        Task<SettingBak> GetLastSettingBakAsync(string key, string dc);

        /// <summary>
        /// 分页查询备份信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<SqlSugarPagedList<SettingBakResponse>> GetPageSettingBaksAsync(PageSettingBakRequest request);

        /// <summary>
        /// 新增备份记录
        /// </summary>
        /// <param name="key"></param>
        /// <param name="dc"></param>
        /// <param name="json"></param>
        /// <param name="remark"></param>
        /// <returns></returns>
        Task<bool> InsertSettingBakAsync(string key, string dc, string json, string remark);

        Task<string> GetConsulKeyValueAsync(string key, string dc);

        Task<bool> EditConsulKeyValueAsync(string key, string dc, string json);
    }
}